Drop GailSeparator
authorMatthias Clasen <mclasen@redhat.com>
Mon, 27 Jun 2011 01:36:11 +0000 (21:36 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 5 Jul 2011 20:08:10 +0000 (16:08 -0400)
Instead, just set a suitable role on a GtkWidgetAccessible.

gtk/a11y/Makefile.am
gtk/a11y/gail.c
gtk/a11y/gailseparator.c [deleted file]
gtk/a11y/gailseparator.h [deleted file]
gtk/gtkseparator.c

index 8674a264fdc0defebeb489bed48cf5da0b5134b9..ab3212b4231c4721e0d26e46372fb0c3c2f5fdc4 100644 (file)
@@ -42,7 +42,6 @@ gail_c_sources =                      \
        gailscalebutton.c               \
        gailscrollbar.c                 \
        gailscrolledwindow.c            \
-       gailseparator.c                 \
        gtkspinbuttonaccessible.c       \
        gailsubmenuitem.c               \
        gailstatusbar.c                 \
@@ -97,7 +96,6 @@ gail_private_h_sources =              \
        gailscalebutton.h               \
        gailscrollbar.h                 \
        gailscrolledwindow.h            \
-       gailseparator.h                 \
        gtkspinbuttonaccessible.h       \
        gailsubmenuitem.h               \
        gailstatusbar.h                 \
index 31fd181f5122b625a73aa32cc2ba7514f207efe8..7ca070bd2570464ce9ea1a90529e7b0f6657e264 100644 (file)
@@ -51,7 +51,6 @@
 #include "gailscalebutton.h"
 #include "gailscrollbar.h"
 #include "gailscrolledwindow.h"
-#include "gailseparator.h"
 #include "gailstatusbar.h"
 #include "gailtextcell.h"
 #include "gailtogglebutton.h"
@@ -127,7 +126,6 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PROGRESS_BAR, GailProgressBar, gail_progress_b
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TREE_VIEW, GailTreeView, gail_tree_view, GTK_TYPE_TREE_VIEW)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_FRAME, GailFrame, gail_frame, GTK_TYPE_FRAME)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_RADIO_BUTTON, GailRadioButton, gail_radio_button, GTK_TYPE_RADIO_BUTTON)
-GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SEPARATOR, GailSeparator, gail_separator, GTK_TYPE_SEPARATOR)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BOX, GailBox, gail_box, GTK_TYPE_BOX)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLED_WINDOW, GailScrolledWindow, gail_scrolled_window, GTK_TYPE_SCROLLED_WINDOW)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PANED, GailPaned, gail_paned, GTK_TYPE_PANED)
@@ -903,7 +901,6 @@ gail_accessibility_module_init (void)
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER, gail_renderer_cell);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_RADIO_BUTTON, gail_radio_button);
-  GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SEPARATOR, gail_separator);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_BOX, gail_box);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SCROLLED_WINDOW, gail_scrolled_window);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_PANED, gail_paned);
diff --git a/gtk/a11y/gailseparator.c b/gtk/a11y/gailseparator.c
deleted file mode 100644 (file)
index 22e9146..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include "gailseparator.h"
-
-static void         gail_separator_class_init            (GailSeparatorClass  *klass);
-static void         gail_separator_init                  (GailSeparator       *accessible);
-static void         gail_separator_initialize            (AtkObject           *accessible,
-                                                          gpointer             data);
-
-G_DEFINE_TYPE (GailSeparator, gail_separator, GAIL_TYPE_WIDGET)
-
-static void
-gail_separator_class_init (GailSeparatorClass *klass)
-{
-  AtkObjectClass  *class = ATK_OBJECT_CLASS (klass);
-
-  class->initialize = gail_separator_initialize;
-}
-
-static void
-gail_separator_init (GailSeparator *accessible)
-{
-}
-
-static void
-gail_separator_initialize (AtkObject *accessible,
-                           gpointer  data)
-{
-  ATK_OBJECT_CLASS (gail_separator_parent_class)->initialize (accessible, data);
-
-  accessible->role = ATK_ROLE_SEPARATOR;
-}
diff --git a/gtk/a11y/gailseparator.h b/gtk/a11y/gailseparator.h
deleted file mode 100644 (file)
index 1f3b377..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* GAIL - The GNOME Accessibility Implementation Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_SEPARATOR_H__
-#define __GAIL_SEPARATOR_H__
-
-#include "gailwidget.h"
-
-G_BEGIN_DECLS
-
-#define GAIL_TYPE_SEPARATOR                  (gail_separator_get_type ())
-#define GAIL_SEPARATOR(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_SEPARATOR, GailSeparator))
-#define GAIL_SEPARATOR_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_SEPARATOR, GailSeparatorClass))
-#define GAIL_IS_SEPARATOR(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_SEPARATOR))
-#define GAIL_IS_SEPARATOR_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_SEPARATOR))
-#define GAIL_SEPARATOR_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_SEPARATOR, GailSeparatorClass))
-
-typedef struct _GailSeparator              GailSeparator;
-typedef struct _GailSeparatorClass         GailSeparatorClass;
-
-struct _GailSeparator
-{
-  GailWidget parent;
-};
-
-GType gail_separator_get_type (void);
-
-struct _GailSeparatorClass
-{
-  GailWidgetClass parent_class;
-};
-
-G_END_DECLS
-
-#endif /* __GAIL_SEPARATOR_H__ */
index e285a40e742bac4de1c05e60ac4341444338bc1c..d67ab2ec6fee3d92b0e6876c8999b149e14bff7c 100644 (file)
@@ -72,6 +72,7 @@ static void       gtk_separator_get_preferred_height
                                               gint           *natural);
 static gboolean   gtk_separator_draw         (GtkWidget      *widget,
                                               cairo_t        *cr);
+static AtkObject *gtk_separator_get_accessible (GtkWidget    *widget);
 
 
 G_DEFINE_TYPE_WITH_CODE (GtkSeparator, gtk_separator, GTK_TYPE_WIDGET,
@@ -91,7 +92,8 @@ gtk_separator_class_init (GtkSeparatorClass *class)
   widget_class->get_preferred_width = gtk_separator_get_preferred_width;
   widget_class->get_preferred_height = gtk_separator_get_preferred_height;
 
-  widget_class->draw         = gtk_separator_draw;
+  widget_class->draw = gtk_separator_draw;
+  widget_class->get_accessible = gtk_separator_get_accessible;
 
   g_object_class_override_property (object_class, PROP_ORIENTATION, "orientation");
 
@@ -272,6 +274,18 @@ gtk_separator_draw (GtkWidget *widget,
   return FALSE;
 }
 
+static AtkObject *
+gtk_separator_get_accessible (GtkWidget *widget)
+{
+  AtkObject *obj;
+
+  obj = GTK_WIDGET_CLASS (gtk_separator_parent_class)->get_accessible (widget);
+
+  atk_object_set_role (obj, ATK_ROLE_SEPARATOR);
+
+  return obj;
+}
+
 /**
  * gtk_separator_new:
  * @orientation: the separator's orientation.